<?php

include("classes/include.php");

if(isset($_POST['suppEnt']) && isset($_POST['select']))
{
	$ent = new Entreprise($_POST['select']);
	
	$ent->supprimer();
	
	header("Location: administrationEntreprise.php"); 
}
if(isset($_POST['ajoutEnt']))
{
	header("Location: administrationAjoutEntreprise.php"); 
}

if(isset($_POST['ajoutAdminEnt']))
{
	if(isset($_POST['nomEnt']) && isset($_POST['addEnt']) && isset($_POST['mailEnt']) && isset($_POST['telEnt']))
	{
		$nomEnt = $_POST['nomEnt'];
		$addEnt = $_POST['addEnt'];
		$mailEnt = $_POST['mailEnt'];
		$telEnt = $_POST['telEnt'];
		
		
		$newEnt = new Entreprise(-1,$nomEnt,$addEnt,$mailEnt,$telEnt);
		
		$newEnt->ajouter();
		
		header("Location: administrationEntreprise.php");
	}
}

header("Location: administrationEntreprise.php"); 

?>